/**
 * 根据共同的配置修改或者直接自定义个性化的配置
 */

import {
  commonProtoConfig,
  defaultChartOptions,
} from '@/components/common/VisualizationComp/ChartConfig/common'

const {
  titleConfig,
  rightLegendConfig,
  tooltipConfig,
  themeColorDiscreteConfig,
  xAxis,
  labelConfig,
} = commonProtoConfig

export const protoConfig = [
  {
    label: '',
    type: 'property',
    children: [
      ...titleConfig,
      ...xAxis,
      {
        type: 'group',
        label: '左Y轴',
        children: [
          {
            type: 'input',
            label: '标题',
            name: 'yAxisLeftTitle',
          },
          {
            type: 'select',
            label: '网格线',
            name: 'yAxisGridStyle',
            defaultValue: 'null',
            props: {
              options: [
                {
                  label: '无',
                  value: 'null',
                },
                {
                  label: '实线',
                  value: 'solid',
                },
                {
                  label: '虚线',
                  value: 'dash',
                },
                {
                  label: '点',
                  value: 'dot',
                },
              ],
            },
          },
          {
            type: 'inputNumber',
            label: '最大边界',
            name: 'yAxisLeftMax',
            defaultValue: '',
          },
          {
            type: 'inputNumber',
            label: '最小边界',
            name: 'yAxisLeftMin',
            defaultValue: '',
          },
        ],
      },
      {
        type: 'group',
        label: '右Y轴',
        defaultValue: false,
        children: [
          {
            type: 'input',
            label: '标题',
            name: 'yAxisRightTitle',
          },
          {
            type: 'inputNumber',
            label: '最大边界',
            name: 'yAxisRightMax',
            defaultValue: '',
          },
          {
            type: 'inputNumber',
            label: '最小边界',
            name: 'yAxisRightMin',
            defaultValue: '',
          },
        ],
      },
      {
        type: 'select',
        label: '展现形式',
        name: 'dualaxesType',
        defaultValue: 'normal',
        props: {
          options: [
            {
              label: '柱线混合图',
              value: 'normal',
            },
            {
              label: '双折线图',
              value: 'line',
            },
          ],
        },
      },
      ...rightLegendConfig,
      ...labelConfig,
      ...tooltipConfig,
      ...themeColorDiscreteConfig,
    ],
  },
]
/**
 * 图表渲染的默认配置
 */
export const defaultOptions = {
  ...defaultChartOptions,
}
